package cn.sanenen.dm.base.util;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;

public class GuiUtils {
    public static JButton createButton(String text, ActionListener actionListener) {
        JButton button = new JButton(text);
        button.setPreferredSize(new Dimension(80, 30));
        button.setBackground(new Color(0, 150, 0));
        button.setForeground(Color.WHITE);
        if (actionListener!=null){
            button.addActionListener(actionListener);
        }
        return button;
    }
}
